
<?php
header('Content-Type:text/html; charset=utf-8');
$cookie=$_COOKIE['cd'];
echo(base64_decode($cookie));
$error=$_FILES["file"]["error"];
$file_size=$_FILES["file"]["size"];
$path=$_FILES["file"]["tmp_name"];
$type=str_replace("/","",substr($_FILES["file"]["type"],-4));
$upload_name=base64_encode($_FILES["file"]["name"]).'.'.$type;
echo($upload_name);
$timestamp = date("YmdHis");
$host = 'localhost';
$user = 'root';
$password = 'Xiangni365';
$database = 'login';
$con = mysqli_connect($host, $user, $password, $database);
$user_c=mysqli_fetch_array(mysqli_query($con,"SELECT user FROM login_check WHERE current_cookie='$cookie'"))[0];
$update=mysqli_query($con,"UPDATE login_check SET face_url='../upload/$timestamp.$type' WHERE user='$user_c'");
echo($user_c);
$move=move_uploaded_file($path, "../upload/$timestamp.$type");
var_dump($update)
?>